﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CarriageType.aspx.cs" Inherits="Shop_CarriageType" %>

<%@ Register Assembly="Infragistics2.WebUI.UltraWebGrid.v7.1, Version=7.1.20071.40, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
    Namespace="Infragistics.WebUI.UltraWebGrid" TagPrefix="igtbl" %>
<%@ Register Assembly="Infragistics2.WebUI.Misc.v7.1, Version=7.1.20071.40, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
    Namespace="Infragistics.WebUI.Misc" TagPrefix="igmisc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>配送方式</title>   
    <link href="../style/main.css" rel="stylesheet" type="text/css" />        

    <script src="../Components/JQuery/JavaScript/jquery.js" type="text/javascript"></script>
    <script src="../Components/JQuery/JavaScript/jquery.funkyUI.js" type="text/javascript"></script>
    
    <script type="text/javascript">
    //获取选中行ID
    function UWG_AfterRowActivateHandler(gridName, rowId)
    {
         //选择行当前行
         var goodId = igtbl_getRowById(rowId).getCellFromKey("ID").getValue();
 
         document.getElementById("hID").value = goodId;                                    
    }
    
    var payType = {}
    
    payType.Add = function(){    
        var ID = $("#hID").val();
     
        $.funkyUI({
				title:"新增配送方式",
			    url:"Shop/CarriageType_Edit.aspx?Type=Add",
			    CancelEvent:cancelEvent,            //点击取消按钮执行的事件
			    css:{width:"400",height:"200"}
		});       
    }        
    payType.Edit = function(){
        var ID = $("#hID").val();
        
        if(ID=="" || ID == null){		
            $.alert("请选择要编辑的行!");
            return false;
        }else{
            $.funkyUI({
				title:"编辑配送方式",
		    	url:"Shop/CarriageType_Edit.aspx?Type=Edit&ID=" + ID,
			    CancelEvent:cancelEvent,            //点击取消按钮执行的事件
			    css:{width:"400",height:"200"}
		    });        
        }
    }     
    payType.Delete = function(){
        var ID = $("#hID").val();
        
        if(ID=="" || ID == null){
            $.alert("请选择要删除的行!");
            return false;
        }else{
            return confirm("确定删除该支付方式吗?")
        }
    }     

	function cancelEvent(){
	    window.location.reload(); 
	}
	
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <center>
        <table style="width: 98%; vertical-align: middle; background-color: #DAE7F8;" border="0px"
            cellpadding="0px" cellspacing="1px">
            <tr>
                <td style="height: 28px">
                    <igmisc:WebPanel ID="WebPanel1" runat="server" BackColor="#DAE7F8" BorderColor="#106DB0"
                        BorderWidth="1px" StyleSetName="" Width="100%" BorderStyle="Solid" Expanded="False">
                        <Header Text="配送方式管理">
                            <ExpandedAppearance>
                                <Styles BackColor="#DAE7F8" Font-Bold="True" Height="26px">
                                </Styles>
                            </ExpandedAppearance>
                        </Header>
                    </igmisc:WebPanel>
                </td>
            </tr>
            <tr>
                <td>
                    <igtbl:UltraWebGrid ID="UWG" runat="server" Height="350px" Width="100%" >
                        <Bands>
                            <igtbl:UltraGridBand AllowUpdate="No">
                                <SelectedRowStyle BackColor="#99FF66" BorderColor="#99FF33" BorderStyle="Solid" BorderWidth="1px" />
                                <Columns>
                                    <igtbl:UltraGridColumn BaseColumnName="ID" Key="ID" Hidden="true">
                                        <Header Caption="">
                                        </Header>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn BaseColumnName="TypeName" HeaderText="配送方式名称" Key="TypeName">
                                        <Header Caption="配送方式名称">
                                            <RowLayoutColumnInfo OriginX="1" />
                                        </Header>
                                        <Footer>
                                            <RowLayoutColumnInfo OriginX="1" />
                                        </Footer>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn BaseColumnName="IsUseType" HeaderText="状态" Key="IsUseType">
                                        <Header Caption="状态">
                                            <RowLayoutColumnInfo OriginX="2" />
                                        </Header>
                                        <Footer>
                                            <RowLayoutColumnInfo OriginX="2" />
                                        </Footer>
                                    </igtbl:UltraGridColumn>           
                                    <igtbl:UltraGridColumn BaseColumnName="Money" HeaderText="收费标准" Key="Money">
                                        <Header Caption="收费标准">
                                            <RowLayoutColumnInfo OriginX="3" />
                                        </Header>
                                        <Footer>
                                            <RowLayoutColumnInfo OriginX="3" />
                                        </Footer>
                                    </igtbl:UltraGridColumn>                                                         
                                </Columns>
                                <AddNewRow Visible="NotSet" View="NotSet">
                                </AddNewRow>
                            </igtbl:UltraGridBand>
                        </Bands>
                        <DisplayLayout Version="4.00" SelectTypeRowDefault="Extended" Name="UWG" AllowSortingDefault="OnClient"
                            AllowDeleteDefault="Yes" AllowColSizingDefault="Free" RowHeightDefault="20px"
                            TableLayout="Fixed" ViewType="Hierarchical" AllowColumnMovingDefault="OnServer"
                            HeaderClickActionDefault="SortMulti" StationaryMargins="Header" BorderCollapseDefault="Separate"
                            StationaryMarginsOutlookGroupBy="True" AutoGenerateColumns="False" CellClickActionDefault="RowSelect"
                            IndentationTypeDefault="Flat" NoDataMessage="没有查询到数据！" UseFixedHeaders="True">
                            <FrameStyle BackColor="Window" BorderColor="" BorderWidth="1px" Font-Names="Microsoft Sans Serif"
                                Font-Size="8.25pt" Height="350px" Width="100%">
                            </FrameStyle>                           
                            <EditCellStyleDefault BorderWidth="0px" BorderStyle="None">
                            </EditCellStyleDefault>
                            <FooterStyleDefault BackColor="LightGray" BorderWidth="1px" BorderStyle="Solid">
                                <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px">
                                </BorderDetails>
                            </FooterStyleDefault>
                            <HeaderStyleDefault HorizontalAlign="Center" BackColor="" BorderStyle="Solid" Height="26px"
                                VerticalAlign="Middle">
                                <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px">
                                </BorderDetails>
                            </HeaderStyleDefault>
                            <RowSelectorStyleDefault Width="10px">
                            </RowSelectorStyleDefault>
                            <RowStyleDefault BackColor="Window" BorderColor="Silver" BorderWidth="1px" BorderStyle="Solid"
                                Font-Names="Microsoft Sans Serif" Font-Size="8.25pt">
                                <Padding Left="3px"></Padding>
                                <BorderDetails ColorLeft="Window" ColorTop="Window"></BorderDetails>
                            </RowStyleDefault>
                            <GroupByRowStyleDefault BackColor="Control" BorderColor="Window">
                            </GroupByRowStyleDefault>
                            <SelectedRowStyleDefault BackColor="#E4FFCA" BorderColor="#99FF99" BorderStyle="Solid"
                                BorderWidth="1px" Cursor="Hand">
                            </SelectedRowStyleDefault>
                            <GroupByBox Hidden="True" Prompt="">
                                <Style BackColor="ActiveBorder" BorderColor="Window">
                                    </Style>
                            </GroupByBox>
                            <AddNewBox>
                                <Style BackColor="Window" BorderColor="InactiveCaption" BorderWidth="1px" BorderStyle="Solid">
                                    <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" > </BorderDetails ></Style>
                            </AddNewBox>
                            <ActivationObject BorderColor="" BorderWidth="">
                            </ActivationObject>
                            <FilterOptionsDefault>
                                <FilterDropDownStyle CustomRules="overflow:auto;" BackColor="White" BorderColor="Silver"
                                    BorderWidth="1px" BorderStyle="Solid" Font-Names="Verdana,Arial,Helvetica,sans-serif"
                                    Font-Size="11px" Height="300px" Width="200px">
                                    <Padding Left="2px"></Padding>
                                </FilterDropDownStyle>
                                <FilterHighlightRowStyle BackColor="#151C55" ForeColor="White">
                                </FilterHighlightRowStyle>
                                <FilterOperandDropDownStyle CustomRules="overflow:auto;" BackColor="White" BorderColor="Silver"
                                    BorderWidth="1px" BorderStyle="Solid" Font-Names="Verdana,Arial,Helvetica,sans-serif"
                                    Font-Size="11px">
                                    <Padding Left="2px"></Padding>
                                </FilterOperandDropDownStyle>
                            </FilterOptionsDefault>
                            <ClientSideEvents AfterRowActivateHandler="UWG_AfterRowActivateHandler" />
                        </DisplayLayout>
                    </igtbl:UltraWebGrid>
                </td>
            </tr> 
             <tr>
                <td style="text-align: left;">
                    &nbsp;&nbsp;
                    <input id="btnAdd" type="button" onclick="return payType.Add()" value="新增" style="width: 90px;" />
                    &nbsp;&nbsp;
                    <input id="btnEdit" type="button" onclick="return payType.Edit()" value="编辑" style="width: 90px;" />
                    &nbsp;&nbsp;
                    <asp:Button ID="btnDelete" runat="server" Text="删除" OnClientClick="return payType.Delete()"
                        Width="90" OnClick="btnDelete_Click" />                                            
                </td>
            </tr>        
        </table>
    </center>
    
    <asp:HiddenField ID="hID" runat="server" />
    
     <!-- 遮照层 -->
    <div id="mask">
    </div>   
    <div id="divEdit" style="display: none; z-index: 2000;">
        <div class="header" onmousedown="MDown(divEdit)">
            <div style="display: inline; cursor: move; width: 220px; position: absolute">
                配送方式
            </div>
            <span onclick="divEdit.style.visibility='hidden'; mask.style.visibility='hidden'"
                style="float: right; display: inline; cursor: hand" title="关闭窗口 ">× </span>
        </div>
        
        <iframe id="editframe" frameborder="0" scrolling="no" width="290px" height="150px"></iframe>
    </div>
    
    </form>
</body>
</html>
